package com.fingard.dsp.bank.directbank.czb03;

import com.fingard.dsp.bank.directbank.bankInterface.IBillPool;
import com.fingard.dsp.bank.reqrespobj.billpool.*;


/*
 * 浙商银行票据池
 * */
public class CZB03BillPool extends CZB03Base implements IBillPool {
    @Override
    public RetAtsB301OperBillQry BP001_OperBill_Req(ReqB301OperBillQry query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB302InPoolPledge BP101_InPoolPledge_Req(ReqB302InPoolPledge query) throws Exception {
        return null;
    }


    @Override
    public RetAtsB304ImPledge BP102_ImPledge(ReqB304Impledge query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB305DealStateQry BP002_DealStateQry(ReqB305DealStateQry query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB306PoolAmountQry BP003_PoolAmountQry(ReqB306PoolAmountQry query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB307PoolAmountAdjust BP103_PoolAmountAdjust(ReqB307PoolAmountAdjust query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB308PoolAmonutAdustQry BP004_AdjustQry(ReqB308PoolAmountAdjustQry query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB309BillApply BP104_BillApply(ReqB309BillApply query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB310ShortLoan BP105_ShortLoan(ReqB310ShortLoan query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB311AssuranceTransmit BP107_AssuranceTransmit(ReqB311AssuranceTransmit query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB312AssuranceDetail BP005_AssuracneDetail(ReqB312AssuranceDetail query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB315LoanDetail BP006_LoanDetail(ReqB315LoanDetail query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB311LoanRepay BP106_LoanRepay(ReqB311LoanRepay query) throws Exception {
        return null;
    }


    @Override
    public RetAtsB324InPoolRegister BP009_InPoolRegister(ReqB324InPoolRegister query) throws Exception {
        return null;
    }

    @Override
    public RetAtsBP008BillStateQry BP008_BillState_Qeury(ReqBP008BillStateQry query) throws Exception {
        return null;
    }


    @Override
    public RetAtsBP108BillCancSubmit BP108_BillWithdrawalReq(ReqBP108BillCancSubmit query) throws Exception {
        return null;
    }

    @Override
    public RetAtsBP109BillRespSubmit BP109_BillPublicrReply(ReqBP109BillRespSubmit query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB317OnlineFinancingApply BP901_OnlineFinancingApply(ReqB317OnlineFinancingApply query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB318FinancingApplyQry BP902_FinancingApplyQry(ReqB318FinancingApplyQry query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB319RebuildFile BP903_RebuildFile(ReqB319RebuildFile query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB320ConfirmApplicationContract BP904_ConfirmApplicationContract(ReqB320ConfirmApplicationContract query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB321QryFinancingApply BP905_QryFinancingApply(ReqB321QryFinancingApply query) throws Exception {
        return null;
    }

    @Override
    public RetAtsB311AssuranceTransmit BP007_AssuranceTransmitQry(ReqB329AssuranceTransmitQry query) throws Exception {
        return null;
    }

//    @Override
////    可质押票据查询 开发完成 测试通过
//    public RetAtsB301OperBillQry D_B301_OperBill_Req(ReqB301OperBillQry query) throws Exception {
//        RetAtsB301OperBillQry B301 = new RetAtsB301OperBillQry(query.reqHeader);
//        B301.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ0023";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeNewHeader(xmlWriter, header);
//            writeB301Loop(1, xmlWriter, query);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            int TotalPage = analysisB301Loop(retStrArr, B301);
//
//            for (int i = 2; i <= TotalPage; i++) {
//                xmlWriter = new XmlTextWriter();
//                writeNewHeader(xmlWriter, header);
//                writeB301Loop(i, xmlWriter, query);
//
//                retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                analysisB301Loop(retStrArr, B301);
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("报错原因：" + ex.getMessage());
//            return B301;
//        }
//        B301.writeEnd();
//        return B301;
//    }
//
//    @Override
////    入池申请 开发完成 测试完成
//    public RetAtsB302InPoolPledge D_B302_InPoolPledge_Req(ReqB302InPoolPledge query) throws Exception {
//        RetAtsB302InPoolPledge B302 = new RetAtsB302InPoolPledge(query.reqHeader);
//        B302.writeStart();
//
//        try {
//            while (query.readRecord()) {
//                CZB03Header header = new CZB03Header();
//                header.transCode = "PJ2003";
//                header.reqSeqNo = query.reqHeader.reqSeqID;
//
//                XmlTextWriter xmlWriter = new XmlTextWriter();
//                xmlWriter.autoFormat = false;
//                writeNewHeader(xmlWriter, header);
//                XElement tmpXElement = new XElement("body", "");
//
//                tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//                tmpXElement.addChild(new XElement("billNos", query.detail.BillNum));
//                tmpXElement.addChild(new XElement("cifCustNo", query.detail.CIFCode));
//                tmpXElement.addChild(new XElement("custAccount", query.detail.AccountNum));
//                tmpXElement.addChild(new XElement("pawneeName", query.detail.PawneeName));
//
//                tmpXElement.addChild(new XElement("pawneeAccount", query.detail.PawneeAccount));
//                tmpXElement.addChild(new XElement("pawneeBankNo", query.detail.PawneeCNAPSCode));
//                tmpXElement.addChild(new XElement("electronUnderwrite", "YQDJ"));        //电子签名
//                tmpXElement.addChild(new XElement("batchNo", query.detail.BatchNo));
//                tmpXElement.addChild(new XElement("fromRemark", query.detail.Remark));
//
//                xmlWriter.writeXElement(tmpXElement);
//                xmlWriter.writeEndElement();
//                xmlWriter.writeEndDocument();
//
//                String body = xmlWriter.getContentBetweenTag("body");
//                String SignData = signData(body);
//                xmlWriter.insertIntoTag("Sign", SignData);
//
//                String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                if (retStrArr[0].length() == 0) {
//                    StringBuilder tmpSbMsg = new StringBuilder();
//                    XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                    if (tmpBkReader != null) {
//                        String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                        String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                        if ("000000".equals(tmpRetCode)) {
//                            RetAtsB302InPoolPledgeDetail retAteDetail = new RetAtsB302InPoolPledgeDetail();
//                            B302.RespCode = tmpRetCode;
//                            retAteDetail.PayInfoCode = tmpRetCode;
//                            B302.RespInfo = tmpRetInfo;
//                            retAteDetail.TransState = tmpRetCode;
//                            B302.wirteRetDetail(retAteDetail);
//                        } else {
//                            B302.writeRespCode("-1");
//                            B302.writeRespInfo(tmpRetInfo);
//                        }
//                    } else {
//                        B302.writeRespCode("-1");
//                        B302.writeRespInfo(tmpSbMsg.toString());
//                    }
//                } else {
//                    B302.writeRespCode("-1");
//                    B302.writeRespInfo(retStrArr[1].toString());
//                }
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//        B302.writeRetAtsXml(B302);
//        return B302;
//    }
//
//    @Override
//    //入池质押撤销
//    public RetAtsB303InPoolPledgeCancel D_B303_PledgeCancel(ReqB303InPoolPledgeCancel query) throws Exception {
//        RetAtsB303InPoolPledgeCancel B302 = new RetAtsB303InPoolPledgeCancel(query.reqHeader);
//        B302.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ0025";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
//            writeNewHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//
//            tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//            tmpXElement.addChild(new XElement("billNos", query.BillNum));
//            tmpXElement.addChild(new XElement("custAccount", query.AccountNum));
//            tmpXElement.addChild(new XElement("electronUnderwrite", "YQDJ"));        //电子签名
//            tmpXElement.addChild(new XElement("userNo", "1"));                           //操作员号
//            tmpXElement.addChild(new XElement("remark1", ""));
//            tmpXElement.addChild(new XElement("remark2", ""));
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                    if ("000000".equals(tmpRetCode)) {
//                        B302.RespCode = tmpRetCode;
//                        B302.PayInfoCode = tmpRetCode;
//                        B302.RespInfo = tmpRetInfo;
//                        B302.TransState = tmpRetCode;
//                        B302.writeRetAtsXml(B302);
//                    } else {
//                        B302.writeRespCode("-1");
//                        B302.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B302.writeRespCode("-1");
//                    B302.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B302.writeRespCode("-1");
//                B302.writeRespInfo(retStrArr[1].toString());
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//        B302.writeEnd();
//        return B302;
//    }
//
//    @Override
////    质押撤销 开发完成 测试通过
//    public RetAtsB304ImPledge D_B304_ImPledge(ReqB304Impledge query) throws Exception {
//        RetAtsB304ImPledge B304 = new RetAtsB304ImPledge(query.reqHeader);
//        B304.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ2004";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
//            writeNewHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//
//            tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//            tmpXElement.addChild(new XElement("cifCustNo", query.CIFCode));
//            tmpXElement.addChild(new XElement("custAccount", query.AccountNum));
//            tmpXElement.addChild(new XElement("electronUnderwrite", "YQDJ"));    //电子签名
//            tmpXElement.addChild(new XElement("batchNo", ""));      //批次号，暂时未用到
//
//            tmpXElement.addChild(new XElement("billNos", query.BillNum));
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                    if ("000000".equals(tmpRetCode)) {
//                        B304.RespCode = tmpRetCode;
//                        B304.PayInfoCode = tmpRetCode;
//                        B304.RespInfo = tmpRetInfo;
//                        B304.TransState = tmpRetCode;
//                        B304.writeRetAtsXml(B304);
//                    } else {
//                        B304.writeRespCode("-1");
//                        B304.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B304.writeRespCode("-1");
//                    B304.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B304.writeRespCode("-1");
//                B304.writeRespInfo(retStrArr[1].toString());
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//        B304.writeEnd();
//        return B304;
//    }
//
//    @Override
//    //浙商银行未支持
//    public RetAtsB305DealStateQry D_B305_DealStateQry(ReqB305DealStateQry query) throws Exception {
//        return null;
//    }
//
//    @Override
////  票据池额度查看 开发完成 测试通过
//    public RetAtsB306PoolAmountQry D_B306_PoolAmountQry(ReqB306PoolAmountQry query) throws Exception {
////        RetAtsB306PoolAmountQry B306 = new RetAtsB306PoolAmountQry(query.reqHeader);
////        B306.writeStart();
////
////        try {
////            CZB03Header header = new CZB03Header();
////            header.transCode = "PJ1003";
////            header.reqSeqNo = query.reqHeader.reqSeqID;
////
////            XmlTextWriter xmlWriter = new XmlTextWriter();
////            writeNewHeader(xmlWriter, header);
////            writeB3036Loop(1, xmlWriter, query);
////
////            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
////
////            int TotalPage = analysisB306Loop(retStrArr, B306);
////
////            for (int i = 2; i <= TotalPage; i++) {
////                xmlWriter = new XmlTextWriter();
////                writeCommonHeader(xmlWriter, header);
////                writeB3036Loop(i, xmlWriter, query);
////
////                retStrArr = sendToBank(xmlWriter.toXmlString());
////
////                analysisB306Loop(retStrArr, B306);
////            }
////            B306.writeEnd();
////        } catch (Exception ex) {
////            WriteBankLogLn("报错原因：" + ex.getMessage());
////            return B306;
////        }
////
////        return B306;
//        return null;
//    }
//
//    @Override
////    池额度调整 开发完成 测试通过
//    public RetAtsB307PoolAmountAdjust D_B307_PoolAmountAdjust(ReqB307PoolAmountAdjust query) throws Exception {
//        RetAtsB307PoolAmountAdjust B307 = new RetAtsB307PoolAmountAdjust(query.reqHeader);
//        B307.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "500006";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
//            writeCommonHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//
//            tmpXElement.addChild(new XElement("acno", query.AccountNum));
//            tmpXElement.addChild(new XElement("adjust_amount", query.AllocatedAmount));
//            tmpXElement.addChild(new XElement("max_financelimit", query.PoolTopLimit));
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/ap/head/ret_code");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/ap/head/ret_info");
//                    if ("0000".equals(tmpRetCode)) {
//                        B307.RespCode = "000000";
//                        B307.RespInfo = tmpRetInfo;
//                        B307.PayInfoCode = tmpRetCode + "00";
//                        B307.TransState = tmpRetCode + "00";
//                        B307.ReqSeqID = query.reqHeader.reqSeqID;
//                        B307.writeRetAtsXml(B307);
//                    } else {
//                        B307.writeRespCode("-1");
//                        B307.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B307.writeRespCode("-1");
//                    B307.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B307.writeRespCode("-1");
//                B307.writeRespInfo(retStrArr[1].toString());
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//        B307.writeEnd();
//        return B307;
//    }
//
//    @Override
////    票据池调剂查询 开发完成 测试通过
//    public RetAtsB308PoolAmonutAdustQry D_B308_AdjustQry(ReqB308PoolAmountAdjustQry query) throws Exception {
//        RetAtsB308PoolAmonutAdustQry B308 = new RetAtsB308PoolAmonutAdustQry(query.reqHeader);
//        B308.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ2002";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeNewHeader(xmlWriter, header);
//            writeB308Loop(1, xmlWriter, query);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            int TotalPage = analysisB308Loop(retStrArr, B308);
//
//            for (int i = 2; i <= TotalPage; i++) {
//                xmlWriter = new XmlTextWriter();
//                writeCommonHeader(xmlWriter, header);
//                writeB308Loop(i, xmlWriter, query);
//
//                retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                analysisB308Loop(retStrArr, B308);
//            }
//            B308.writeEnd();
//        } catch (Exception ex) {
//            WriteBankLogLn("错误信息：" + ex.getMessage());
//            return B308;
//        }
//
//
//        return B308;
//    }
//
//    @Override
////    申请出票 开发完成  签名通过 测试通过
//    public RetAtsB309BillApply D_B309_BillApply(ReqB309BillApply query) throws Exception {
//        RetAtsB309BillApply B309 = new RetAtsB309BillApply(query.reqHeader);
//        B309.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ2005";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
////            writeNeedSignHeader(xmlWriter,header,true);
//            writeNewHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//
//            tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//            tmpXElement.addChild(new XElement("cifCustNo", query.CIFCode));
//            tmpXElement.addChild(new XElement("remitterCustAcct", query.OutAccountNum));
//            tmpXElement.addChild(new XElement("warteeSign", "YQDJ"));    //电子签名
//            tmpXElement.addChild(new XElement("isDeliver", query.AutoNotice));
//
//            tmpXElement.addChild(new XElement("batchNo", "1"));  //批次号
//            tmpXElement.addChild(new XElement("billType", query.BillType));
//            tmpXElement.addChild(new XElement("dueDt", query.DueDate));
//            tmpXElement.addChild(new XElement("billMoney", query.BillAmount));
//            tmpXElement.addChild(new XElement("payee", query.ReceiverName));
//
//            tmpXElement.addChild(new XElement("payeeAcct", query.ReceiverAccountNum));
//            tmpXElement.addChild(new XElement("payeeBank", query.ReceiverBankName));
//            tmpXElement.addChild(new XElement("payeeBankNo", query.ReceiverCNASPCode));
//            tmpXElement.addChild(new XElement("acceptor", query.InName));
//            tmpXElement.addChild(new XElement("acceptorAcct", query.InAccount));
//
//            tmpXElement.addChild(new XElement("acceptorBank", query.InBankName));
//            tmpXElement.addChild(new XElement("acceptorBankNo", query.InCNASPCode));
//            tmpXElement.addChild(new XElement("draweeBank", query.OutBankName));
//            tmpXElement.addChild(new XElement("draweeBankNo", query.OutCNASPCode));
//            tmpXElement.addChild(new XElement("draweeBankAddr", ""));    //付款行地址
//
//            tmpXElement.addChild(new XElement("protEndors", query.TransmitFlag));
//            tmpXElement.addChild(new XElement("remitterRemark", ""));    //出票人备注
//            tmpXElement.addChild(new XElement("acmsBcConferNo", query.ContractReqNum));
//            tmpXElement.addChild(new XElement("isAssure", "0")); //0-不保税 1-保税
//            tmpXElement.addChild(new XElement("isThrough", "0")); //0-非直通车；1-资产池直通车；2-企银池直通车
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                    if ("000000".equals(tmpRetCode)) {
//                        B309.RespCode = tmpRetCode;
//                        B309.PayInfoCode = tmpRetCode;
//                        B309.RespInfo = tmpRetInfo;
//                        B309.TransState = tmpRetCode;
//                        B309.ReqSeqID = query.reqHeader.reqSeqID;
//                        B309.writeRetAtsXml(B309);
//                    } else {
//                        B309.writeRespCode("-1");
//                        B309.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B309.writeRespCode("-1");
//                    B309.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B309.writeRespCode("-1");
//                B309.writeRespInfo(retStrArr[1].toString());
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("错误原因：" + ex.getMessage());
//        }
//        B309.writeEnd();
//        return B309;
//
//    }
//
//    @Override
////    超短贷 开发完成
//    public RetAtsB310ShortLoan D_B310_ShortLoan(ReqB310ShortLoan query) throws Exception {
//        RetAtsB310ShortLoan B310 = new RetAtsB310ShortLoan(query.reqHeader);
//        B310.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ1001";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
//            writeNewHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//
//            tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//            tmpXElement.addChild(new XElement("CifCustNo", query.CIFCode));
//            tmpXElement.addChild(new XElement("BusinessSum", query.Amount));
//            tmpXElement.addChild(new XElement("PutOutDate", query.StartDate));
//            tmpXElement.addChild(new XElement("Maturity", query.EndDate));
//            tmpXElement.addChild(new XElement("Purpose", query.Usage));
//
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                    if ("000000".equals(tmpRetCode)) {
//                        B310.ContractNum = tmpBkReader.getFirstText("/response/body/ArtificialNo");
//                        B310.ContractReqID = tmpBkReader.getFirstText("/response/body/BCSerialNo");
//                        B310.RespCode = tmpRetCode;
//                        B310.RespInfo = tmpRetInfo;
//                        B310.ReqSeqID = query.reqHeader.reqSeqID;
//                        B310.TransState = tmpRetCode;
//                        B310.PayInfoCode = tmpRetCode;
//                        B310.writeRetAtsXml(B310);
//                    } else {
//                        B310.writeRespCode("-1");
//                        B310.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B310.writeRespCode("-1");
//                    B310.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B310.writeRespCode("-1");
//                B310.writeRespInfo(retStrArr[1].toString());
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//
//        B310.writeEnd();
//        return B310;
//    }
//
//    @Override
////    保证金划转 开发完成 测试完成
//    public RetAtsB311AssuranceTransmit D_B312_AssuranceTransmit(ReqB311AssuranceTransmit query) throws Exception {
//        RetAtsB311AssuranceTransmit B311 = new RetAtsB311AssuranceTransmit(query.reqHeader);
//        B311.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            if (query.MoneyWay.equals("1")) {
//                header.transCode = "PJ1002";
//            } else if (query.MoneyWay.equals("2")) {
//                header.transCode = "PJ1004";
//            }
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            xmlWriter.autoFormat = false;
//            writeNewHeader(xmlWriter, header);
//            XElement tmpXElement = new XElement("body", "");
//            if (query.MoneyWay.equals("1")) {
//                tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//                tmpXElement.addChild(new XElement("CifCustNo", query.CIFCode));
//                tmpXElement.addChild(new XElement("OutAmountType", query.TransmitType));
//                tmpXElement.addChild(new XElement("OutAmount", query.TransmitAmount));
//                tmpXElement.addChild(new XElement("Currency", "01"));   //人名币
//            } else if (query.MoneyWay.equals("2")) {
//                tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//                tmpXElement.addChild(new XElement("CifCustNo", query.CIFCode));
//                tmpXElement.addChild(new XElement("Amount", query.TransmitAmount));
//                tmpXElement.addChild(new XElement("Currency", "01"));
//            }
//
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                    if ("000000".equals(tmpRetCode)) {
//                        B311.RespCode = "000000";
//                        B311.PayInfoCode = tmpRetCode;
//                        B311.RespInfo = tmpRetInfo;
//                        B311.TransState = tmpRetCode;
//                        B311.ReqSeqID = query.reqHeader.reqSeqID;
//                        B311.writeRetAtsXml(B311);
//                    } else {
//                        B311.writeRespCode("-1");
//                        B311.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B311.writeRespCode("-1");
//                    B311.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B311.writeRespCode("-1");
//                B311.writeRespInfo(retStrArr[1].toString());
//            }
//
//        } catch (Exception ex) {
//            WriteBankLogLn("");
//        }
//        B311.writeEnd();
//        return B311;
//    }
//
//    @Override
////   保证金归集明细查看 开发完成
//    public RetAtsB312AssuranceDetail D_B313_AssuracneDetail(ReqB312AssuranceDetail query) throws Exception {
//        if ("1".equals(query.QueryType)) {
//            return AssuranceDetail(query);
//        }
//
//        RetAtsB312AssuranceDetail B312 = new RetAtsB312AssuranceDetail(query.reqHeader);
//        B312.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "500004";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeCommonHeader(xmlWriter, header);
//
//            writeB312Loop(1, xmlWriter, query);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            int TotalPage = analysisB312Loop(retStrArr, B312);
//
//            for (int i = 2; i <= TotalPage; i++) {
//                xmlWriter = new XmlTextWriter();
//                writeCommonHeader(xmlWriter, header);
//                writeB312Loop(i, xmlWriter, query);
//
//                retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                analysisB312Loop(retStrArr, B312);
//            }
//            B312.writeEnd();
//
//        } catch (Exception ex) {
//            WriteBankLogLn("错误原因：" + ex.getMessage());
//        }
//        B312.writeEnd();
//        return B312;
//    }
//
//    //贷款信息查询 测试通过
//    public RetAtsB315LoanDetail D_B315_LoanDetail(ReqB315LoanDetail query) throws Exception {
//        RetAtsB315LoanDetail B315 = new RetAtsB315LoanDetail(query.reqHeader);
//        B315.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ1005";
//            header.reqSeqNo = query.ReqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeNewHeader(xmlWriter, header);
//            xmlWriter.autoFormat = false;
//            XElement tmpXElement = new XElement("body", "");
//            tmpXElement.addChild(new XElement("ExSerial", query.ReqSeqID));
//            tmpXElement.addChild(new XElement("CifCustNo", query.CIFCode));
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//
//                    if ("000000".equals(tmpRetCode)) {
//                        B315.writeRespCode(tmpRetCode);
//                        B315.writeRespInfo(tmpRetInfo);
//                        while (tmpBkReader.read("/response/body/DuebillList")) {
//                            B315.AccountNum = tmpBkReader.readedXElement.getSingleText("LoanAcct");
//                            B315.DebitNo = tmpBkReader.readedXElement.getSingleText("DebitNo");
//                            B315.EndDate = tmpBkReader.readedXElement.getSingleText("MatDate").replace("-", "");
//                            B315.Interest = tmpBkReader.readedXElement.getSingleText("Rate");
//                            B315.State = tmpBkReader.readedXElement.getSingleText("LoanStat");
//
//                            B315.PayCur = "1";  //暂时只支持人民币
//                            B315.LoanBal = tmpBkReader.readedXElement.getSingleText("LoanBal");
//                            B315.LoanLimit = tmpBkReader.readedXElement.getSingleText("LoanAmt");
//                            B315.RepayType = tmpBkReader.readedXElement.getSingleText("RepayType");
//                            B315.StartDate = tmpBkReader.readedXElement.getSingleText("LoanDate").replace("-", "");
//                            B315.writeRetAtsXml();
//                        }
//                    } else {
//                        B315.writeRespCode("-1");
//                        B315.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B315.writeRespCode("-1");
//                    B315.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B315.writeRespCode("-1");
//                B315.writeRespInfo(retStrArr[1]);
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("错误原因：" + ex.toString());
//        }
//        B315.writeEnd();
//        return B315;
//    }
//
//    @Override
//    public RetAtsB314BillDetail D_B314_BillDetail(ReqB314BillDetail query) throws Exception {
//        RetAtsB314BillDetail B301 = new RetAtsB314BillDetail(query.reqHeader);
//        B301.writeStart();
//
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "500002";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeCommonHeader(xmlWriter, header);
//            writeB314Loop(1, xmlWriter, query);
//
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            int TotalPage = analysisB314Loop(retStrArr, B301);
//
//            for (int i = 2; i <= TotalPage; i++) {
//                xmlWriter = new XmlTextWriter();
//                writeNewHeader(xmlWriter, header);
//                writeB314Loop(i, xmlWriter, query);
//
//                retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                analysisB314Loop(retStrArr, B301);
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("报错原因：" + ex.getMessage());
//            return B301;
//        }
//        B301.writeEnd();
//        return B301;
//    }
//
//    @Override
//    public RetAtsB311LoanRepay D_B311_LoanRepay(ReqB311LoanRepay query) throws Exception {
//        RetAtsB311LoanRepay B311 = new RetAtsB311LoanRepay(query.reqHeader);
//        B311.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ1006";
//            header.reqSeqNo = query.ReqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeNewHeader(xmlWriter, header);
//            xmlWriter.autoFormat = false;
//            XElement tmpXElement = new XElement("body", "");
//            tmpXElement.addChild(new XElement("ExSerial", query.ReqSeqID));
//            tmpXElement.addChild(new XElement("DebitNo", query.DebitNo));
//            tmpXElement.addChild(new XElement("DepAcctNum", query.AccountNum));
//            tmpXElement.addChild(new XElement("RepaymentType", query.RepayType));
//            tmpXElement.addChild(new XElement("Amount", query.Amount));
//            tmpXElement.addChild(new XElement("Flag", query.Flag));
//            tmpXElement.addChild(new XElement("CifCustNo", query.CIFCode));
//            xmlWriter.writeXElement(tmpXElement);
//            xmlWriter.writeEndElement();
//            xmlWriter.writeEndDocument();
//            String body = xmlWriter.getContentBetweenTag("body");
//            String SignData = signData(body);
//            xmlWriter.insertIntoTag("Sign", SignData);
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            if (retStrArr[0].length() == 0) {
//                StringBuilder tmpSbMsg = new StringBuilder();
//                XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//                if (tmpBkReader != null) {
//                    String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                    String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//
//                    if ("000000".equals(tmpRetCode)) {
//                        B311.RespCode = "000000";
//                        B311.PayInfoCode = tmpRetCode;
//                        B311.RespInfo = tmpRetInfo;
//                        B311.TransState = tmpRetCode;
//                        B311.ReqSeqID = query.ReqSeqID;
//                        B311.writeRetAtsXml(B311);
//                    } else {
//                        B311.writeRespCode("-1");
//                        B311.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B311.writeRespCode("-1");
//                    B311.writeRespInfo(tmpSbMsg.toString());
//                }
//            } else {
//                B311.writeRespCode("-1");
//                B311.writeRespInfo(retStrArr[1]);
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("错误原因：" + ex.toString());
//        }
//        B311.writeEnd();
//        return B311;
//    }
//
//    @Override
//    public RetAtsB317OnlineFinancingApply D_B317_OnlineFinancingApply(ReqB317OnlineFinancingApply query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB318FinancingApplyQry D_B318_FinancingApplyQry(ReqB318FinancingApplyQry query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB319RebuildFile D_B319_RebuildFile(ReqB319RebuildFile query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB320ConfirmApplicationContract D_B320_ConfirmApplicationContract(ReqB320ConfirmApplicationContract query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB321QryFinancingApply D_B321_QryFinancingApply(ReqB321QryFinancingApply query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB322PoolProcessResultQry D_B322_PoolProcessResultQry(ReqB322PoolProcessResultQry query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB323PoolQuotaInformationQry D_B323_PoolQuotaInformationQry(ReqB323PoolQuotaInformationQry query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB324InPoolRegister D_B324_InPoolRegister(ReqB324InPoolRegister query) throws Exception {
//        return null;
//    }
//
//
//    @Override
//    public RetAtsB26BillPledSubmit D_B326_BillPledSubmit(ReqB326BillPledSubmit query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB112BillCancSubmit D_B327_BillWithdrawalReq(ReqB112BillCancSubmit query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB003BillRespSubmit D_B328_BillPublicrReply(ReqB003BillRespSubmit query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB311AssuranceTransmit D_B329_AssuranceTransmitQry(ReqB329AssuranceTransmitQry query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB330EndorsementTransfer D_B330_EndorsementTransfer(ReqB330EndorsementTransfer query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB331DiscountApplication D_B331_DiscountApplication(ReqB331DiscountApplication query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB332PromptPayment D_B332_PromptPayment(ReqB332PromptPayment query) throws Exception {
//        return null;
//    }
//
//    @Override
//    public RetAtsB006BillStateQry D_B325_BillState_Qeury(ReqB006BillStateQry query) throws Exception {
//        return null;
//    }
//
//    //region
//    public void writeB301Loop(int p_Page, XmlTextWriter xmlWriter, ReqB301OperBillQry query) {
//        xmlWriter.autoFormat = false;
//        XElement tmpXElement = new XElement("body", "");
//
//        tmpXElement.addChild(new XElement("ExSerial", query.ReqSeqID));
//        tmpXElement.addChild(new XElement("custAccNo", query.AccountNum));
//        tmpXElement.addChild(new XElement("operType", query.OperType));
//        tmpXElement.addChild(new XElement("billType", ""));  //默认全部
//        tmpXElement.addChild(new XElement("acceptor", ""));
//
//        tmpXElement.addChild(new XElement("pageCount", "50"));
//        tmpXElement.addChild(new XElement("currentPageNo", p_Page + ""));
//        tmpXElement.addChild(new XElement("remark1", ""));
//        tmpXElement.addChild(new XElement("remark2", ""));
//
//        xmlWriter.writeXElement(tmpXElement);
//        xmlWriter.writeEndElement();
//        xmlWriter.writeEndDocument();
//    }
//
//    public void writeB314Loop(int p_Page, XmlTextWriter xmlWriter, ReqB314BillDetail query) {
//        xmlWriter.autoFormat = false;
//        XElement tmpXElement = new XElement("body", "");
//
//        tmpXElement.addChild(new XElement("is_group", query.IsGroup));
//        tmpXElement.addChild(new XElement("acno", query.AccountNum));
//        tmpXElement.addChild(new XElement("bill_status", query.BillState));
//        tmpXElement.addChild(new XElement("begin_date", query.BeginDate));  //默认全部
//        tmpXElement.addChild(new XElement("end_date", query.EndDate));
//
//        tmpXElement.addChild(new XElement("pageno", p_Page + ""));
//
//        xmlWriter.writeXElement(tmpXElement);
//        xmlWriter.writeEndElement();
//        xmlWriter.writeEndDocument();
//    }
//
//    public void writeB3036Loop(int p_Page, XmlTextWriter xmlWriter, ReqB306PoolAmountQry query) {
////        xmlWriter.autoFormat = false;
////        XElement tmpXElement = new XElement("body", "");
////
////        tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
////        tmpXElement.addChild(new XElement("CifCustNo", query.CifCustNo));
////        tmpXElement.addChild(new XElement("IsGroup", query.IsGroup));
////        tmpXElement.addChild(new XElement("AccNo", query.AccountNum));
////        tmpXElement.addChild(new XElement("PageNo", p_Page + ""));
////
////        tmpXElement.addChild(new XElement("PageCount", "10"));
////
////        xmlWriter.writeXElement(tmpXElement);
////        xmlWriter.writeEndElement();
////        xmlWriter.writeEndDocument();
//    }
//
//    public void writeB308Loop(int p_Page, XmlTextWriter xmlWriter, ReqB308PoolAmountAdjustQry query) {
//        xmlWriter.autoFormat = false;
//        XElement tmpXElement = new XElement("body", "");
//
//        tmpXElement.addChild(new XElement("ExSerial", query.reqHeader.reqSeqID));
//        tmpXElement.addChild(new XElement("hostCifCustNo", query.HostID));
//        tmpXElement.addChild(new XElement("memberCifCustNo", query.ClientID));
//        tmpXElement.addChild(new XElement("startdate", query.StartDate));
//        tmpXElement.addChild(new XElement("endDate", query.EndDate));
//
//        tmpXElement.addChild(new XElement("managerCifCustNo", query.BankCIFCode));
//        tmpXElement.addChild(new XElement("pageNo", p_Page + ""));
//        tmpXElement.addChild(new XElement("pageCount", "20"));
//
//
//        xmlWriter.writeXElement(tmpXElement);
//        xmlWriter.writeEndElement();
//        xmlWriter.writeEndDocument();
//    }
//
//    public void writeB312Loop(int p_Page, XmlTextWriter xmlWriter, ReqB312AssuranceDetail query) {
//        xmlWriter.autoFormat = false;
//        XElement tmpXElement = new XElement("body", "");
//
//        tmpXElement.addChild(new XElement("is_group", query.IsGroup));
//        tmpXElement.addChild(new XElement("acno", query.AccountNum));
//        tmpXElement.addChild(new XElement("begin_date", query.StartDate));
//        tmpXElement.addChild(new XElement("end_date", query.EndDate));
//        tmpXElement.addChild(new XElement("pageno", "1"));
//
//        xmlWriter.writeXElement(tmpXElement);
//        xmlWriter.writeEndElement();
//        xmlWriter.writeEndDocument();
//    }
//
//    public void writeB312Type2(int p_Page, XmlTextWriter xmlWriter, ReqB312AssuranceDetail query) {
//        xmlWriter.autoFormat = false;
//
//        XElement tmpXElement = new XElement("body", "");
//        tmpXElement.addChild(new XElement("ExSerial", getQryTransID()));
//        tmpXElement.addChild(new XElement("cifCustNo", query.CIFCode));
//        tmpXElement.addChild(new XElement("custAccount", query.AccountNum));
//        tmpXElement.addChild(new XElement("orgCode", ""));
//        tmpXElement.addChild(new XElement("status", "0"));
//
//        tmpXElement.addChild(new XElement("startDate", query.StartDate));
//        tmpXElement.addChild(new XElement("endDate", query.EndDate));
//        tmpXElement.addChild(new XElement("pageNo", p_Page + ""));
//        tmpXElement.addChild(new XElement("pageCount", "10"));
//
//        xmlWriter.writeXElement(tmpXElement);
//        xmlWriter.writeEndElement();
//        xmlWriter.writeEndDocument();
//
//    }
//
//    public int analysisB301Loop(String[] retStrArr, RetAtsB301OperBillQry B301) throws Exception {
//        if (retStrArr[0].length() == 0) {
//            StringBuilder tmpSbMsg = new StringBuilder();
//            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//            if (tmpBkReader != null) {
//                String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//
//                if ("000000".equals(tmpRetCode)) {
//                    B301.writeRespCode(tmpRetCode);
//                    B301.writeRespInfo(tmpRetInfo);
//
//                    String TotalPage = tmpBkReader.getSimpleText("totalPage");
//                    while (tmpBkReader.read("/response/body/list")) {
//                        RetAtsB301OperBillQryDetail detail = new RetAtsB301OperBillQryDetail();
//
//                        detail.BillNum = tmpBkReader.readedXElement.getSingleText("billNo");
//                        detail.BillType = tmpBkReader.readedXElement.getSingleText("billType");
//                        detail.DrawDate = tmpBkReader.readedXElement.getSingleText("acptDate");
//                        detail.DueDate = tmpBkReader.readedXElement.getSingleText("dueDate");
//                        detail.BillMoney = tmpBkReader.readedXElement.getSingleText("billAmt");
//
//                        detail.Acceptor = tmpBkReader.readedXElement.getSingleText("acceptor");
//                        detail.Interest = tmpBkReader.readedXElement.getSingleText("interest");
//                        B301.writeDetail(detail);
//                    }
//                    int tmpTotalPage = Integer.parseInt(TotalPage);
//                    return tmpTotalPage;
//                } else {
//                    B301.writeRespCode("-1");
//                    B301.writeRespInfo(tmpRetInfo);
//                }
//            } else {
//                B301.writeRespCode("-1");
//                B301.writeRespInfo(tmpSbMsg.toString());
//            }
//        } else {
//            B301.writeRespCode("-1");
//            B301.writeRespInfo(retStrArr[1].toString());
//        }
//        return 1;
//    }
//
//    public int analysisB314Loop(String[] retStrArr, RetAtsB314BillDetail B301) throws Exception {
//        if (retStrArr[0].length() == 0) {
//            StringBuilder tmpSbMsg = new StringBuilder();
//            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//
//            if (tmpBkReader != null) {
//                String tmpRetCode = tmpBkReader.getFirstText("/ap/head/ret_code");
//                String tmpRetInfo = tmpBkReader.getFirstText("/ap/head/ret_info");
//
//                if ("0000".equals(tmpRetCode)) {
//                    B301.writeRespCode(tmpRetCode + "00");  //统一处理000000
//                    B301.writeRespInfo(tmpRetInfo);
//
//                    String TotalPage = tmpBkReader.getSimpleText("total_pages");
//                    while (tmpBkReader.read("/ap/head/record")) {
//                        RetAtsB314 detail = new RetAtsB314();
//
//                        detail.BillNum = tmpBkReader.readedXElement.getSingleText("billNo");
//                        detail.BillType = tmpBkReader.readedXElement.getSingleText("billType");
//                        detail.DrawDate = tmpBkReader.readedXElement.getSingleText("acptDate");
//                        detail.DueDate = tmpBkReader.readedXElement.getSingleText("dueDate");
//                        detail.BillMoney = tmpBkReader.readedXElement.getSingleText("billAmt");
//
//                        detail.Acceptor = tmpBkReader.readedXElement.getSingleText("acceptor");
//                        detail.Interest = tmpBkReader.readedXElement.getSingleText("interest");
//                        B301.writeDetail(detail);
//                    }
//                    int tmpTotalPage = Integer.parseInt(TotalPage);
//                    return tmpTotalPage;
//                } else {
//                    B301.writeRespCode("-1");
//                    B301.writeRespInfo(tmpRetInfo);
//                }
//            } else {
//                B301.writeRespCode("-1");
//                B301.writeRespInfo(tmpSbMsg.toString());
//            }
//        } else {
//            B301.writeRespCode("-1");
//            B301.writeRespInfo(retStrArr[1].toString());
//        }
//        return 1;
//    }
//
//    public int analysisB306Loop(String[] retStrArr, RetAtsB306PoolAmountQry B306) throws Exception {
////        if (retStrArr[0].length() == 0) {
////            StringBuilder tmpSbMsg = new StringBuilder();
////            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
////            if (tmpBkReader != null) {
////                String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
////                String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
////
////                if ("000000".equals(tmpRetCode)) {
////                    B306.writeRespCode(tmpRetCode);
////                    B306.writeRespInfo(tmpRetInfo);
////                    RetAtsB306PoolAmountQryDetail detail = new RetAtsB306PoolAmountQryDetail();
////                    String TotalPage = tmpBkReader.getSimpleText("TotalPages");
////
////                    while (tmpBkReader.read("/response/body/poolCreditInfo4YQTListOutBean")) {
////                        detail.EntityName = tmpBkReader.readedXElement.getSingleText("CustName");
////                        detail.EntityAccount = tmpBkReader.readedXElement.getSingleText("CustAccount");
////                        detail.AmountState = tmpBkReader.readedXElement.getSingleText("CreditStatus");
////                        detail.AllocatedAmount = tmpBkReader.readedXElement.getSingleText("AdjustAmount");
////                        detail.PoolTopLimit = tmpBkReader.readedXElement.getSingleText("MaxFinanceLimit");
////
////                        detail.TotalAmount = tmpBkReader.readedXElement.getSingleText("CreditAmount");
////                        detail.ValidDate = tmpBkReader.readedXElement.getSingleText("CreditEndDate");
////                        detail.AvailableAmount = tmpBkReader.readedXElement.getSingleText("UsableLineSum");
////                        detail.UsedAmount = tmpBkReader.readedXElement.getSingleText("UsedLineSum");
////                        detail.BailAmount = tmpBkReader.readedXElement.getSingleText("BailAmount");
////                        detail.AccountType = tmpBkReader.readedXElement.getSingleText("CalculateModel");
////                        B306.writeDetail(detail);
////                    }
////                    return Integer.parseInt(TotalPage);
////                } else {
////                    B306.writeRespCode("-1");
////                    B306.writeRespInfo(tmpRetInfo);
////                }
////            } else {
////                B306.writeRespCode("-1");
////                B306.writeRespInfo(tmpSbMsg.toString());
////            }
////        } else {
////            B306.writeRespCode("-1");
////            B306.writeRespInfo(retStrArr[1].toString());
////        }
////        return 1;
//    }
//
//    public int analysisB308Loop(String[] retStrArr, RetAtsB308PoolAmonutAdustQry B308) throws Exception {
//        if (retStrArr[0].length() == 0) {
//            StringBuilder tmpSbMsg = new StringBuilder();
//            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//            if (tmpBkReader != null) {
//                String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//                if ("000000".equals(tmpRetCode)) {
//                    B308.writeRespCode(tmpRetCode);
//                    B308.writeRespInfo(tmpRetInfo);
//
//                    RetAtsB308PoolAmountAdjustQryDetail detail = new RetAtsB308PoolAmountAdjustQryDetail();
//                    String TotalPage = tmpBkReader.getSimpleText("totalPages");
//                    while (tmpBkReader.read("/response/body/record")) {
//                        detail.HostAccountNum = tmpBkReader.readedXElement.getSingleText("hostCustAccount");
//                        detail.HostName = tmpBkReader.readedXElement.getSingleText("hostCustName");
//                        detail.ClientAccountNum = tmpBkReader.readedXElement.getSingleText("memberCustAccount");
//                        detail.ClientName = tmpBkReader.readedXElement.getSingleText("memberCustName");
//                        detail.AccountType = tmpBkReader.readedXElement.getSingleText("calculateModel");
//
//                        detail.PoolTopLimit = tmpBkReader.readedXElement.getSingleText("maxFinanceLimit");
//                        detail.AdjustAmount = tmpBkReader.readedXElement.getSingleText("adjustAmount");
//                        detail.TransDate = tmpBkReader.readedXElement.getSingleText("operDate").replace("-", "");
//                        detail.AllocatedClientAccountNum = tmpBkReader.readedXElement.getSingleText("managerCustAccount");
//                        detail.AllocatedClientName = tmpBkReader.readedXElement.getSingleText("managerCustName");
//                        B308.writeDetail(detail);
//                    }
//                    return Integer.parseInt(TotalPage);
//                } else {
//                    B308.writeRespCode("-1");
//                    B308.writeRespInfo(tmpRetInfo);
//                }
//            } else {
//                B308.writeRespCode("-1");
//                B308.writeRespInfo(tmpSbMsg.toString());
//            }
//        } else {
//            B308.writeRespCode("-1");
//            B308.writeRespInfo(retStrArr[1]);
//        }
//        return 1;
//    }
//
//    public int analysisB312Loop(String[] retStrArr, RetAtsB312AssuranceDetail B312) throws Exception {
//        if (retStrArr[0].length() == 0) {
//            StringBuilder tmpSbMsg = new StringBuilder();
//            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//            if (tmpBkReader != null) {
//                String tmpRetCode = tmpBkReader.getFirstText("/ap/head/ret_code");
//                String tmpRetInfo = tmpBkReader.getFirstText("/ap/head/ret_info");
//
//                if ("0000".equals(tmpRetCode)) {
//
//                    B312.writeRespCode(tmpRetCode + "00");
//                    B312.writeRespInfo(tmpRetInfo);
//
//                    RetAtsB312Detail detail = new RetAtsB312Detail();
//                    String TotalPage = tmpBkReader.getSimpleText("totalPages");
//                    while (tmpBkReader.read("/ap/body/record")) {
//                        detail.OutName = tmpBkReader.readedXElement.getSingleText("out_custname");
//                        detail.OutAccountNum = tmpBkReader.readedXElement.getSingleText("out_acno");
//                        detail.InName = tmpBkReader.readedXElement.getSingleText("in_custname");
//                        detail.InAccountNum = tmpBkReader.readedXElement.getSingleText("in_acno");
//                        detail.AccountType = tmpBkReader.readedXElement.getSingleText("calculate_mode");
//
//                        detail.CollectAmount = tmpBkReader.readedXElement.getSingleText("bail_amount");
//                        detail.CollectDate = tmpBkReader.readedXElement.getSingleText("create_time");
//                        B312.writeDetail(detail);
//                    }
//                    return Integer.parseInt(TotalPage);
//                } else {
//                    B312.writeRespCode("-1");
//                    B312.writeRespInfo(tmpRetInfo);
//                }
//            } else {
//                B312.writeRespCode("-1");
//                B312.writeRespInfo(tmpSbMsg.toString());
//            }
//        } else {
//            B312.writeRespCode("-1");
//            B312.writeRespInfo(retStrArr[1]);
//        }
//        return 1;
//    }
//
//    public int analysisB312QueryType2(String[] retStrArr, RetAtsB312AssuranceDetail B312, int CurPage) throws Exception {
//        int Page = 0;
//        if (retStrArr[0].length() == 0) {
//            StringBuilder tmpSbMsg = new StringBuilder();
//            XmlTextReader tmpBkReader = loadBankRespXmlReader(retStrArr[1], tmpSbMsg);
//            if (tmpBkReader != null) {
//                String tmpRetCode = tmpBkReader.getFirstText("/response/head/ErrorNo");
//                String tmpRetInfo = tmpBkReader.getFirstText("/response/head/ErrorInfo");
//
//                if ("000000".equals(tmpRetCode)) {
//                    RetAtsB312Detail detail = new RetAtsB312Detail();
//                    String TotalPage = tmpBkReader.getSimpleText("totalPages");
//                    String TotalRows = tmpBkReader.getSimpleText("totalRows");
//                    while (tmpBkReader.read("/response/body/record")) {
//                        detail.InName = tmpBkReader.readedXElement.getSingleText("accname");
//                        detail.InAccountNum = tmpBkReader.readedXElement.getSingleText("accno");
//                        detail.AccountType = tmpBkReader.readedXElement.getSingleText("calculate_mode");
//
//                        detail.CollectAmount = tmpBkReader.readedXElement.getSingleText("amt");
//                        detail.CollectDate = tmpBkReader.readedXElement.getSingleText("tradeDate");
//                        detail.HostSerialno = tmpBkReader.readedXElement.getSingleText("hostSerialNo");
//                        detail.MoneyWay = tmpBkReader.readedXElement.getSingleText("tradeFlag");
//                        detail.TranTime = tmpBkReader.readedXElement.getSingleText("tradeTime");
//                        detail.ReceiptNo = tmpBkReader.readedXElement.getSingleText("receiptNo");
//                        B312.writeDetail(detail);
//                    }
//
//                    Page = Integer.parseInt(TotalPage);
//                    if (Page == CurPage) {
//                        B312.writeRespCode(tmpRetCode);
//                        B312.writeRespInfo(tmpRetInfo);
//                    }
//                } else {
//                    B312.writeRespCode("-1");
//                    B312.writeRespInfo(tmpRetInfo);
//                }
//            } else {
//                B312.writeRespCode("-1");
//                B312.writeRespInfo(tmpSbMsg.toString());
//            }
//        } else {
//            B312.writeRespCode("-1");
//            B312.writeRespInfo(retStrArr[1]);
//        }
//        return Page;
//    }
//    //endregion
//
//    public RetAtsB312AssuranceDetail AssuranceDetail(ReqB312AssuranceDetail query) {
//        RetAtsB312AssuranceDetail B311 = new RetAtsB312AssuranceDetail(query.reqHeader);
//        B311.writeStart();
//        try {
//            CZB03Header header = new CZB03Header();
//            header.transCode = "PJ2011";
//            header.reqSeqNo = query.reqHeader.reqSeqID;
//
//            XmlTextWriter xmlWriter = new XmlTextWriter();
//            writeNewHeader(xmlWriter, header);
//            writeB312Type2(1, xmlWriter, query);
//            String[] retStrArr = sendToBank(xmlWriter.toXmlString());
//
//            int TotalPage = analysisB312QueryType2(retStrArr, B311, 1);
//
//            for (int i = 2; i <= TotalPage; i++) {
//                xmlWriter = new XmlTextWriter();
//                writeNewHeader(xmlWriter, header);
//                writeB312Type2(i, xmlWriter, query);
//
//                retStrArr = sendToBank(xmlWriter.toXmlString());
//
//                analysisB312QueryType2(retStrArr, B311, i);
//            }
//        } catch (Exception ex) {
//            WriteBankLogLn("错误原因 :" + ex.getMessage());
//            B311.writeEnd();
//            return B311;
//        }
//        B311.writeEnd();
//        return B311;
//    }
}
